#!/usr/bin/env python

import wx
import component
import resource.icon as icon

import __main as main

class Main(component.Frame):
    '''Main object
    
    @author Julot <andy.julot@gmail.com>
    @since Saturday, January 14, 2012. 09:01 AM'''
    
    def __init__(self):
        super(Main, self).__init__(None, name='Main')
        import app
        meta = app.Meta()
        self.Title = '%s Version %s' % (meta.name, meta.long_version)
        self.Icon = icon.Main.Icon
        self._realize()
    
    def _realize(self):
        self.MenuBar = main.MenuBar()
        self.ToolBar = main.ToolBar(self)
        self.ToolBar.Realize()
        self.StatusBar = wx.StatusBar(self)
        
        style = wx.SP_LIVE_UPDATE
        self.vSplitter = wx.SplitterWindow(self, style=style)
        self.vSplitter.SetMinimumPaneSize(50)

        self.files = main.Files(self.vSplitter)
        
        self.hSplitter = wx.SplitterWindow(self.vSplitter, style=style)
        self.hSplitter.SetMinimumPaneSize(50)
        
        self.image = main.Image(self.hSplitter)
        self.form = main.Form(self.hSplitter)
        
        self.hSplitter.SplitHorizontally(self.image, self.form)
        
        self.vSplitter.SplitVertically(self.files, self.hSplitter)
        
        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(self.vSplitter, 1, wx.GROW)
        
        self.SetSizer(sizer)
        